<template>
    <div class="list-item-wrapper" ref="list-item" :class="active"
         @mousedown="handleMousedown"
         @click="handleClick"
         @mouseup="handleMouseup"
         @touchstart="handleMousedown">
        <slot></slot>
    </div>
</template>

<script>
    export default {
        name: 'myListItem',
        data() {
            return{
                active: ''
            }
        },
        methods: {
            handleMousedown() {
                this.active = 'active'
            },
            handleClick(e) {
                window.console.log(e)
            },
            handleMouseup() {
                this.active = ''
            }
        }
    }
</script>

<style scoped>
    .list-item-wrapper {
        text-align: center;
        width: 100%;
        padding: .2rem;
        box-sizing: border-box;
        color: #6f6f6f;
        font-size: .4rem;
        border-bottom: 1px solid #cecece;
    }
    .active {
        background: #efefef;
    }
</style>
